package com.inspur.cdc.server.control.bmcconfig.trap.impl;

import com.inspur.cdc.server.control.sdk.bmcconfig.trap.TrapService;
import com.inspur.cdc.server.control.sdk.adapter.BmcConfigAdapter;
import com.inspur.cdc.server.control.sdk.bmcconfig.trap.bean.TrapConfigBean;
import com.inspur.cdc.server.control.sdk.bmcconfig.trap.bean.TrapConfigResult;

public class TrapServiceImpl implements TrapService {

    private BmcConfigAdapter bmcConfigAdapter;

    public TrapServiceImpl(BmcConfigAdapter bmcConfigAdapter) {
        this.bmcConfigAdapter = bmcConfigAdapter;
    }

    @Override
    public TrapConfigResult trapConfig(TrapConfigBean trapConfigBean) {
//        TrapConfigResult trapConfigResult = new TrapConfigResult();
//        trapConfigResult.setFlag(true);
//        trapConfigResult.setMsg("Trap Config Success!");
        TrapConfigResult trapConfigResult = bmcConfigAdapter.trapConfig(trapConfigBean);
        return trapConfigResult;
    }

    @Override
    public TrapConfigResult trapConfigDefault(TrapConfigBean trapConfigBean) {
//        TrapConfigResult trapConfigResult = new TrapConfigResult();
//
//        trapConfigResult.setFlag(false);
//        trapConfigResult.setMsg("Trap default config fail!");

        TrapConfigResult trapConfigResult = bmcConfigAdapter.trapConfig(trapConfigBean);
        trapConfigResult.setMsg("");
        return trapConfigResult;
    }
}
